/**  
 * @Title:  PlatformFilterConfig.java   
 * @Package com.platform.config    
 * @author: <a href="mailto:15909910367@163.com">吴先生</a> 
 * @date:   2022年11月2日 下午6:26:43   
 * @version V1.0 
 * @Copyright: 2022 吴先生.
 */
package com.platform.config;

import java.util.ArrayList;
import java.util.List;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;

import com.platform.filter.ValidateFilter;

/**
 * @ClassName: PlatformFilterConfig
 * @Description: 系统过滤器
 * @date: 2022年11月2日 下午6:26:43
 * @author: <a href="mailto:15909910367@163.com">吴先生</a>
 * @Copyright: 2022 吴元森.
 */
@Configuration
public class PlatformFilterConfig {
	@Bean
	public FilterRegistrationBean<ValidateFilter> filterRegistrationBean() {
		FilterRegistrationBean<ValidateFilter> registrationBean = new FilterRegistrationBean<ValidateFilter>();
		ValidateFilter filter = new ValidateFilter();
		registrationBean.setFilter(filter);
		List<String> urlPatterns = new ArrayList<String>();
		urlPatterns.add("/*");
		registrationBean.setUrlPatterns(urlPatterns);
		registrationBean.setOrder(Ordered.HIGHEST_PRECEDENCE);
		return registrationBean;
	}
}
